<%- column_div :type => :primary do -%>
  <div class="profile vcard">
    <h2>Profile: <span class="fn n"><%= h @person.name %></span></h2>
    <%- if admin? and not @person.active? -%>
      <p class="error">This person is not active</p>
    <%- end -%>
    <%- if current_person?(@person) -%>
      <%- if current_person.description.blank? -%>
        <div class="error">
          Your description is blank.
          <%= link_to "Click here to add a description",
                      edit_person_path(@person) %>
        </div>
      <%- else -%>
        <div class="notice">
          You are viewing your own profile.
          <%= link_to "Click here to edit it", edit_person_path(@person) %>
        </div>
      <%- end -%>
    <%- end -%>
    <div class="toolbox">
      <%= image_tag @person.main_photo, :class => "profile-image photo",
                                        :alt => h(@person.name) %>
<script language=javascript>
function changefriend(id,result)
{
	$('friend'+id+'_1').setStyle({display:( result?'block':'none')});
	$('friend'+id+'_0').setStyle({display: (result?'none':'block')});
}
function changefollower(id)
{
	$('follower'+id).setStyle({display: 'none'});
}
</script>
      <%- unless current_person?(@person) -%>
        <ul class="tools">
         <%- if logged_in? -%>
          <%-
          friend_man= FriendManager.new(current_person.id)
          -%>
            <li>
            <div id='friend<%=@person.id%>'>
            <input type=hidden name=friend_id value='<%=@person.id%>'></input>
            <input type=hidden id=action<%=@person.id%> name=action2 value='addf'></input>
            </div>
            <div id='friend<%=@person.id%>_1' style='display:<%= friend_man.is_friend?(@person.id) ? 'block':'none' %>'>
            <%= link_to_remote "remove friendship with #{h @person.name}!",:submit=>("friend"+(@person.id.to_s)),:url    => change_friends_path,:before=>("$('action"+(@person.id.to_s)+"').value='delf'"), :method => :get %>
            </div>
            <div id='friend<%=@person.id%>_0'  style='display:<%= friend_man.is_friend?(@person.id) ? 'none':'block' %>'>
            <%= link_to_remote "make friend with #{h @person.name}!",:submit=>("friend"+(@person.id.to_s)),:url    => change_friends_path,:before=>("$('action"+(@person.id.to_s)+"').value='addf'"), :method => :get %>
            </div>
             <% if friend_man.is_follower?(@person.id) %>
            <div id='follower<%=@person.id%>'>
            <%= link_to_remote "refuse follower #{h @person.name}!",:submit=>("friend"+(@person.id.to_s)),:url    => change_friends_path,:before=>("$('action"+(@person.id.to_s)+"').value='delfollower'"), :method => :get %>
            </div>
             <%end %>
            </li>
          <li><%= email_link @person %></li>
        <%- end -%>
          <li><%= link_to "#{h @person.name}'s blog",
                  blog_path(@person.blog) %></li>
          <%- if current_person.admin? -%>
          <li>
          <%- activity = @person.deactivated? ? "activate" : "deactivate" -%>
          <%= link_to activity, 
                      admin_person_path(@person, :task => "deactivated"),
                      :method => :put %>
          </li>
          <%- end -%>
        </ul>
      <%- end -%>
    </div>
    <%= display @person.description %>
  </div>

  <%= render :partial => 'recent_activity' %>
  <%= render :partial => 'wall' %>
<%- end -%>

<%- column_div :type => :secondary do -%>
  <%= render :partial => 'shared/minifeed' %>
  <%- if logged_in? -%>
    <%= render :partial => 'shared/contacts_preview',
               :locals => { :person => @person } %>
    <%= render :partial => 'common_contacts' %>
  <%- end -%>
<%- end -%>

